package com.key.mapper;

import com.key.common.dto.BorrowDTO;
import com.key.common.vo.AssetsTVO;
import com.key.common.vo.AssetsVO;
import com.key.entity.Assets;
import com.key.entity.BorrowAssets;
import com.key.entity.ReceiptAssets;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author wen
 * @create 2023-02-21 10:11
 */
public interface BorrowAssetsMapper {
    //添加一个借用单据
    int insertBorrow(BorrowAssets borrowAssets);
    //将借用单据与相关资产关联
    int insertBorrowAndAssets(@Param("borrowNumber") String borrowNumber, @Param("assetsId") long assetsId);

    //依据单号删除借用单
    int deleteBorrowAssetsByBorrowNumbers(@Param("BorrowNumbers") String BorrowNumbers);

    //依据条件修改单据
    int updateBorrowAssets(BorrowDTO borrowDTO);

    //去除单据与资产的联系
    int updateBorrowAndAssets(@Param("BorrowNumbers") String BorrowNumbers);

    //依据条件查找借用单信息
    List<BorrowAssets> selectBorrow(BorrowDTO borrowDTO);

    //依据条件查找借用单信息总数
    int selectBorrowCount(BorrowDTO borrowDTO);

    //查询当前用户借用中的的单号资源
    List<BorrowAssets> selectCanReturnBorrowAssets(@Param("s") String s);
    //根据借用单号查找资产
    List<Assets> selectAssetsByBorrowAssetsNumber(@Param("borrowNumber")String borrowNumber);

    //根据借用单号查找资产
    List<AssetsTVO> selectAssetsTVOByBorrowAssetsNumber(@Param("borrowNumber")String borrowNumber);


}
